package com.cube.truthseer.common.utils;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
 
/**
 * 获取请求头中的token工具类
 */
public class UserRequest {
	public static String getCurrentToken() {
		HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
				.getRequest();
		String accessToken = request.getHeader("accessToken");
		return accessToken;
	}
}